// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Configs.generated.h"

UENUM(BlueprintType)		//"BlueprintType" is essential to include
enum class RunMode : uint8
{
	Init = 1	  UMETA(DisplayName = "Init"),
	MakeModel = 2 	UMETA(DisplayName = "MakeModel"),
	Read = 3	  UMETA(DisplayName = "Read"),
	Write = 4	UMETA(DisplayName = "Write"),
	CreateWall=5 UMETA(DisplayName = "Wall"),
	WriteToFile=6 UMETA(DisplayName = "WriteToFile"),
	ReadFromFile=7 UMETA(DisplayName = "ReadFromFile"),
};

#define LEVEL 10000

UCLASS()
class MYKAI_API AConfigs : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AConfigs();
	//Map Level
	const int Level=LEVEL;
	UPROPERTY(EditAnyWhere)
		int MaxNum;
	UPROPERTY(EditAnyWhere)
		int intervel_X;
	UPROPERTY(EditAnyWhere)
		int intervel_Y;
	UPROPERTY(EditANyWhere, Category = con)
		TSubclassOf<class AModelX> Model[100];
	UPROPERTY(EditANyWhere, Category = Parm)
		int offset;
	UPROPERTY(EditANyWhere, Category = Parm)
		int Length_X;
	UPROPERTY(EditANyWhere, Category = Parm)
		int Width_Y;
	UPROPERTY(EditANyWhere, Category = Parm)
		int high;
	UPROPERTY(EditANyWhere, Category = Parm)
		class APlacing* p1;
	UPROPERTY(EditANyWhere, Category = Parm)
		class APlacing* p2;
	UPROPERTY(EditANyWhere, Category = Parm)
		class APlacing* p3;
	UPROPERTY(EditANyWhere, Category = transform)
		bool IsLike;
	UPROPERTY(EditANyWhere, Category = transform)
		FVector startLocation;
	UPROPERTY(EditANyWhere, Category = transform)
		FRotator rotator;
		
	UPROPERTY(EditANyWhere, Category = con)
		RunMode mode;

	UPROPERTY(VisibleAnywhere, Category = Init)
		FVector  Init_location;
	UPROPERTY(EditDefaultsOnly, Category = Init)
		int  Init_X;
	UPROPERTY(EditDefaultsOnly, Category = Init)
		int  Init_Y;
	UPROPERTY(EditAnyWhere, Category = con)
		class AMemory* mem;
		
	UPROPERTY(EditAnyWhere, Category = Wall)
		TSubclassOf<AModelX> Wall_Model;
	UPROPERTY(EditAnyWhere, Category = Wall)
		FVector Wall_Interval;
	UPROPERTY(EditAnyWhere, Category = Wall)
		FVector Wall_startLocation;
	UPROPERTY(EditAnyWhere, Category = Wall)
		FRotator Wall_Rotation;
	UPROPERTY(EditAnyWhere, Category = Wall)
		int     Wall_Num;
	//UPROPERTY(VisibleAnywhere, Category= Init)
		TArray<TArray<int>> Load_Map;
		TArray<TArray<int>> Load_Img;

	UPROPERTY(VisibleAnywhere, Category = Init)
		bool Inited;
	UPROPERTY(EditAnyWhere, Category = Init)
		FFilePath bmp;
	bool IsReadMap;
protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;
	void Init_Load(int load_key);
	void Init_Load(class BmpRead br);

	
	
};
